#include "simulation_clock.h"

namespace application {
namespace simulation {

SimulationClock::SimulationClock()
    : m_simulationTime(0.0)
    , m_timeScale(1.0)
    , m_paused(false)
{
}

void SimulationClock::tick(double realDeltaTime) {
    if (!m_paused) {
        m_simulationTime += realDeltaTime * m_timeScale;
    }
}

void SimulationClock::setTimeScale(double scale) {
    if (scale > 0.0) {
        m_timeScale = scale;
    }
}

void SimulationClock::reset() {
    m_simulationTime = 0.0;
    m_paused = false;
}

void SimulationClock::step(double deltaTime) {
    m_simulationTime += deltaTime;
}

} // namespace simulation
} // namespace application
